package com.easy.west.westclient.api.login.api;

import com.easy.west.westclient.api.base.bean.ResultBean;
import com.easy.west.westclient.api.login.bean.ReturenUser;
import com.easy.west.westclient.api.login.bean.User;

import retrofit2.Call;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;

/**
 * restfull登录
 * Created by admin on 2018/5/16.
 */

public interface LoginService{

    /**
     * 登录
     * @param username
     * @param password
     * @return
     */
    @POST("users/loginByPhone")
    @FormUrlEncoded
    Call<ReturenUser> login(@Field("phone") String username, @Field("pwd") String password);

    /**
     * 注册
     * @param phone
     * @param pwd
     * @return
     */
    @POST("users/registUser")
    @FormUrlEncoded
    Call<ReturenUser> regist(@Field("phone")String phone,@Field("pwd")String pwd);

    /**
     * 验证手机号码是否存在
     * @param phone
     * @return
     */
    @POST("users/phoneIsExist")
    @FormUrlEncoded
    Call<Boolean> isPhoneExit(@Field("phone")String phone);

    @POST("users/getPublicKey")
    @FormUrlEncoded
    Call<ResultBean> getPublickey(@Field("phone")String phone);

    @POST("users/update/name")
    @FormUrlEncoded
    Call<User> updateName(@Field("name")String name,@Field("access_token")String access_token);


}
